<{capture name="header"}>
<style media="print">
div{font-size:14pt; }
</style>
<style media="screen">
div{font-size:12px ;}
</style>
<style>
.order-box{ height:auto; padding:10px 10px 0 10px; margin:5px 20px 0 20px; }
.order-box li{ padding:3px 0}
.order-tr{ font-weight:bold; border-bottom:1px solid #ddd}
.table-border{ margin:10px 0; border-color:#333;}
.order-box td{ padding:3px 5px; vertical-align:top}
.order-font{ font-weight:bold; padding:0 5px; clear:both; height:25px; line-height:25px; margin:5px 0 25px 0}
</style>
<{/capture}>

<{if $err=='false'}>
<{foreach from=$items item=item}>
<div style="page-break-after: always; margin:0">
<div class="order-box">
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr><td colspan="2" class="order-tr">发货底单<{if $item.is_code=='true'}>(订单支付方式：货到付款)<{/if}></td></tr>
<tr><td width="65%" rowspan="3" valign="top" style="padding:5px 0"><{$item.delivery_bn|barcode}></td>
  <td valign="middle" style="padding:5px 0">发货单号：<span style="font-weight:bold"><{$item.delivery_bn}></span>
</tr>
<tr>
  <td valign="middle" style="padding:5px 0">会员名：<{$item.member_name}>
</tr>
<tr>
  <td valign="middle" style="padding:5px 0">会员电话：<{$item.member_tel}>
</tr>
<tr><td colspan="2" >打印日期： <{$time}></td></tr>
<tr><td colspan="2">订单号：<{$item.order_bn}></td></tr>
<tr><td colspan="2">预计物流费用：<span style="font-weight:bold; "><{$item.delivery_cost_expect}></span></td></tr>
<tr><td colspan="2">地址：<{$item.consignee.area|region}> <{$item.consignee.addr}></td></tr>
</table>
<table border="1" align="center" width="100%" cellpadding="0"  cellspacing="0"  class="table-border">
  <tr >
    <td><b>序号<b></td>
    <td><b>商品名称</b></td>
    <td><b>商品规格</b></td>
    <td><b>货号</b></td>
    <td><b>数量</b></td>
    <td><b>单价</b></td>
    <td><b>小计</b></td>
  </tr>
<{assign var=amount value="0"}>
<{assign var=idi value="0"}>
<{foreach from=$item.delivery_items item=i}>
<!--<{math assign=amount equation="x + y" x=$amount y=$i.amount}>-->
<tr>
    <td><{math assign=idi equation="x + 1" x=$idi}></td>
    <td><{$i.product_name}></td>
    <td ><{$i.spec_info|default:'--'}></td>
    <td ><{$i.bn}></td>
    <td><{$i.number}></td>
    <td><{$i.price|cur}></td>
    <td><{$i.amount|cur}></td>
</tr>  	
<{/foreach}>
<{if !empty($total)}>
  <tr>
    <td colspan="2" style="text-align:right; padding-right:10px;">共计</td>
    <td style="font-weight:bold;  padding-right:10px;"><{$total}></td>
  </tr>
<{/if}>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-bottom:1px solid #666">
<tr>
<td>物流费用：<{$item.delivery_cost_actual}></td>
<td >发货单数量总计：<{$item.delivery_total_nums}></td>
<td>&nbsp;</td>
<td align="right">总计：<{$amount|cur}></td>
</tr>
</table>
<style>
    #aaa td{border:none;}
</style>


<div class="order-tr" style="padding:0 5px; height:28px; line-height:28px;">收货人信息</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
          <td width="65%" rowspan="5">订单备注：
          <{foreach name="m1" from=$item._mark_text key=key item=item1}>
              <br><{$key}>:
              <{foreach from=$item1 item=it}>
                  <br>&nbsp;&nbsp;&nbsp;&nbsp;<b><{$it.op_content}></b> <{$it.op_time}> by <{$it.op_name}>
              <{/foreach}>
          <{/foreach}>
          <br /><br />订单附言：
          <{foreach name="m2" from=$item._mark key=key item=item2}>
              <br><{$key}>:
              <{foreach from=$item2 item=it}>
                  <br>&nbsp;&nbsp;&nbsp;&nbsp;<b><{$it.op_content}></b> <{$it.op_time}> by <{$it.op_name}>
              <{/foreach}>
          <{/foreach}>
          </td>
          <td >收货人：<{$item.consignee.name}></td>
        </tr>
        <tr>
          <td >电话：<{$item.consignee.telephone}></td>
        </tr>
        <tr>
          <td >手机：<{$item.consignee.mobile}></td>
        </tr>
        <tr>
          <td>邮编：<{$item.consignee.zip}></td>
        </tr>
        <tr>
          <td>地址：<{$item.consignee.area|region}> <{$item.consignee.addr}></td>
        </tr>
  <tr>
    <td colspan="2"><div class="order-font">签字：</div></td>
    </tr>
  <tr>
    <td colspan="2"><div align="right" class="order-font" style="border-bottom:1px dashed #666; height:25px; line-height:25px">Powered by QinqinBaby.com</div></td>
    </tr>
</table>
<div style="clear:both"></div>
</div>
</div>
<{/foreach}>
<{/if}>
<script>
var err = <{$err}>;
if (err==true){
    new Dialog($new("div.tableform",'<div class="division">部分发货单已被合并或者拆分</div><div class="table-action"><{button label="关闭" onclick="re_finder();"}></div>'),{
        title:'提示',
        width:230,
        height:130,
        modal:true,
        resizeable:false});
}

function re_finder(){
    opener.finderGroup['<{$env.get.finder_id}>'].unselectAll();
    opener.finderGroup['<{$env.get.finder_id}>'].refresh.delay(400,opener.finderGroup['<{$env.get.finder_id}>']);
    window.close();
}

function changePrint()
{
    var printname= $('printname').value;
    var a=printname.split(",");
    for(i=0;i<a.length;i++)
    {
        if (a[i] == ''){
            continue;
        }
        new Request({url:'index.php?app=ome&ctl=admin_receipts_print&act=setPrintStatus&p[0]=delivery&p[1]='+a[i],method:'post'}).send();
    }
}

</script>

